<docs>
  ## 我的面试通知
</docs>
<template>
  <!-- 内边距container 开始 -->
  <div class="container">
    <my-bread title="我的面试通知"></my-bread>
    <div class="iContent">
      <pagination-list
        @pullingDown="asyncFetch"
        :no-data="noData"
        class="search-result"
        :ajax-loading="ajaxLoading"
      >
        <position
          v-for="(item,index) in zpxx"
          :key="index"
          :job="item.gwmc"
          :money="item.xc"
          :company="item.dwmc"
          :djsj="item.fbkssj"
          :dwdjid="item.dwdjid"
          :zpgwid="item.zpgwid"
          :jlid="item.jlid"
          :ygxs="item.ygxs"
          :sftxtdjl="item.sftxtdjl"
          :_item="item"
          @link="link_bank"
        ></position>
      </pagination-list>
    </div>
  </div>
</template>
<script>
import $ from "@/common/js/axios";
import { validator } from "common/js/valid";
import PaginationList from "base/paginationList/paginationList";
import Position from "base/job/userjobList";

export default {
  name: "mynoticeList",
  components: { PaginationList, Position },
  data() {
    return {
      ajaxLoading: false,
      noData: false,
      zpxx:[],
      form: {
        pageNum: 1,
        pageSize: "10"
      }
    };
  },
  methods: {
    // link_bank跳转
    link_bank(gwid, dwid, item) {
      this.$router.push({ name: "jobNotice" , query: item });
    },
    // 搜索职位
    GET_search(page = 1) {
      this.$loading = true;
      this.ajaxLoading = true;
      this.form.pageNum = page;
      $.get("/grgl/mstzCx",{params:this.form})
        .then(res => {
          const data = res.returnData;
          // 无查询结果
          if (+data.executeResult === 0) {
            this.noData = true;
            // this.zpxx = [];
            if (page === 1) {
              this.zpxx = [];
            }
          } else {
            this.noData = false;
            // 有数据
            if (page === 1) {
              this.zpxx = data.mstz;
            } else {
              this.zpxx = this.zpxx.concat(data.mstz);
            }
          }
        })
        .finally(() => {
          this.ajaxLoading = false;
          this.$loading = false;
        });
    },
    // async fetach data
    asyncFetch(page) {
      this.GET_search(page);
    },
  },
  created() {
    // this.form.qwgjz = this.$store.getters.qwgjz;
    this.GET_search();
  }
};
</script>
<style scoped lang="scss">
@import "~common/scss/var.scss";

</style>
